package com.ihealthway.all.groupbuy.vo;

import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Id;
import org.nutz.dao.entity.annotation.One;
import org.nutz.dao.entity.annotation.Table;

import java.util.Date;

/**
 * Bean class for sysadmin operate log design
 * @author 凡梦星尘(elkan1788@gmail.com)
 */
@Table("gb_admin_operatelog")
public class AdminLog {

    @Id
    @Column("ol_id")
    private Integer olId;
    @Column("sa_id")
    private Integer saId;
    @One(target = SysAdmin.class, field = "saId", key = "adminId")
    private SysAdmin sysAdmin;
    @Column("operate_type")
    private String operateType;
    @Column("module")
    private String module;
    @Column("content")
    private String content;
    @Column("ip_addr")
    private String ipAddr;
    @Column("remarks")
    private String remarks;
    @Column("create_time")
    private Date createTime;

    private String nickName;

    public Integer getOlId() {
        return olId;
    }

    public void setOlId(Integer olId) {
        this.olId = olId;
    }

    public Integer getSaId() {
        return saId;
    }

    public void setSaId(Integer saId) {
        this.saId = saId;
    }

    public SysAdmin getSysAdmin() {
        return sysAdmin;
    }

    public void setSysAdmin(SysAdmin sysAdmin) {
        this.sysAdmin = sysAdmin;
        if (this.sysAdmin != null) {
            setNickName(sysAdmin.getNickName());
        }
    }

    public String getOperateType() {
        return operateType;
    }

    public void setOperateType(String operateType) {
        this.operateType = operateType;
    }

    public String getModule() {
        return module;
    }

    public void setModule(String module) {
        this.module = module;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getIpAddr() {
        return ipAddr;
    }

    public void setIpAddr(String ipAddr) {
        this.ipAddr = ipAddr;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    @Override
    public String toString() {
        return "AdminLog{" +
                "olId=" + olId +
                ", saId=" + saId +
                ", sysAdmin=" + sysAdmin +
                ", operateType='" + operateType + '\'' +
                ", module='" + module + '\'' +
                ", content='" + content + '\'' +
                ", ipAddr='" + ipAddr + '\'' +
                ", remarks='" + remarks + '\'' +
                ", createTime=" + createTime +
                '}';
    }
}
